home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / cnet / ffish_sim10b.lha / lakeeditor1.0a < prev    next >
Text File  |  1993-02-21  |  8KB  |  319 lines

  1. /*
  2.  
  3.        Freshwater Fishing Simulator
  4.              Lake Creator V1.0
  5.                 By Matrix
  6.  
  7.        Genesis BBS  804-887-3584
  8.         19200 - 250 Megs - Wares
  9.  
  10.    
  11.  
  12.    FOR USE ON A REGISTERED CNET BBS ONLY 
  13.   -------------------------------------------------
  14.    This is the editor I created and used to make
  15.    the lakes for my game. It's pretty bare bones but
  16.    I wanted you to be able to make some lakes of your
  17.    own while you wait for a revision. This is my
  18.    first arexx project so have some heart.
  19.                                                     */
  20. /*Housekeeping **************************************/
  21. options results
  22. signal on error
  23. signal on syntax
  24. signal on ioerr
  25. /*Shortcuts *****************************************/
  26. tr = Transmit
  27. ss = Sendstring
  28. sf = Sendfile
  29. path = "pfiles:fishing/lakedata/"
  30. path1= "pfiles:fishing/lakemaps/"
  31. path2= "pfiles:fishing/files/"
  32. call DATA
  33.  
  34. /*Start *********************************************/
  35.  
  36. START:
  37. tr"f1n2         FRESHWATER SIMULATOR FILE CREATOR"
  38. tr"n2 1. Create Lake Maps and Data"
  39. tr"  2. RESET Tournament and Largest Fish Caught data files"
  40. tr"  3. Quit"
  41. ss"n1 What do you want to do? >"
  42. getchar;ans=result
  43.   if ans=1 then signal CREATE
  44.   if ans=2 then signal RESET
  45.   if ans=3 then signal QUIT
  46. signal START
  47.  
  48. CREATE:
  49. ss"f1n2"
  50. ss "What shall the Lake/River be Named? :"
  51.     receive; lakename = result
  52.     if lakename = "" then signal CREATE
  53. call FISH
  54. call MAPPING
  55. signal SAVE
  56. exit
  57.  
  58. MAPPING:
  59. ss"f1n2 Mapping The Lake...w1f1";r="0";extend="";s="0"
  60.  do y = 3 to 17
  61.  row.y = ""
  62.  cmap.y = ""
  63.       do z = 1 to 41
  64.        ss "f0n"||s||extend||cmap.y||"q1"
  65.        if z = 41 then iterate z
  66.        call ENTER  
  67.        if ans = "L" then do;
  68.           row.y=row.y||"000"
  69.           cmap.y = cmap.y||map.0
  70.           iterate z;end
  71.        if ans = "D" then do;
  72.           launch=1
  73.           row.y=row.y||"770"
  74.           cmap.y = cmap.y||map.7
  75.           posX=z;posY=y
  76.           iterate z;end
  77.        if ans = "A" then signal QUIT
  78.        if ans = "W" then do;
  79.           call DEPTH;call TYPE;call HOT;end
  80.           row.y = row.y||type||depth||hot
  81.        end
  82.    if y <9 then do;s=s+1;end
  83.    if y >=9 then do; 
  84.       r=r+1;extend = "n"||r;end
  85.  end
  86. return
  87.  
  88. ENTER:
  89. tr "f0n5"
  90. tr ">9>9>9>9>9Lake: "||lakename
  91. tr "n1>9>9>9>9>9"||map.0||"q1 - Land"
  92. tr ">9>9>9>9>9"||map.1||"q1 - 0  - 10ft"
  93. tr ">9>9>9>9>9"||map.3||"q1 - 10 - 20ft"
  94. tr ">9>9>9>9>9"||map.5||"q1 - 20 - 30ft"
  95. tr ">9>9>9>9>9"||map.7||"q1 - Dock"
  96. yyy=y-2
  97. tr "f0n9n6 Coordinate: "||yyy||","||"   h3"||z
  98. tr "                                              "
  99. tr "          [L]and                              "
  100. tr "          [W]ater                             "
  101. tr "          [D]ock                              "
  102. tr "          [A]bort                             "
  103. ss " Command?>                                    "
  104. ss "                                              "
  105. ss "                                                              n1^2>9>1" 
  106.    getchar
  107.    ans = upper(result)
  108.    if ans = "L" then return
  109.    if ans = "W" then return
  110.    if ans = "A" then return
  111.    if ans = "D" then do;
  112.       if launch ~=1 then return
  113.       Tr "0HOnly ONE start0Hlocation allowed"
  114.       end
  115. signal ENTER
  116. return
  117.  
  118. DEPTH:
  119. ss"f0n9n6"
  120. tr "Depth:             h9h4"
  121. tr "      1.   5ft            4. 20ft"
  122. tr "      2.  10ft            5. 25ft" 
  123. tr "      3.  15ft            6. 30ft"
  124. tr "                                         "
  125. tr "                                         "
  126. ss "Enter #1-6 Indicating Depth >"
  127.     getchar
  128.     ans = upper(result)
  129.     if ans<1 | ans>6 then signal DEPTH
  130.     if ans = 1 then cmap.y = cmap.y||map.1
  131.     if ans = 2 then cmap.y = cmap.y||map.2
  132.     if ans = 3 then cmap.y = cmap.y||map.3
  133.     if ans = 4 then cmap.y = cmap.y||map.4
  134.     if ans = 5 then cmap.y = cmap.y||map.5
  135.     if ans = 6 then cmap.y = cmap.y||map.6
  136.     depth = ans
  137. return
  138.  
  139. TYPE:
  140. type="0"
  141. call SURFACE
  142. call BOTTOM
  143. return
  144.  
  145. SURFACE:
  146. ss "f0n9n6"
  147. tr "Surface:                         "
  148. tr "           1.  Open Water        "
  149. tr "           2.  Lily Pads         "
  150. tr "           3.  Weeds             "
  151. tr "                                 "
  152. tr "                                 "
  153. ss "Enter a Number Indicating Surface Feature>"
  154.    getchar
  155.    ans = upper(result)
  156.    if ans >3 | ans <1 then signal SURFACE
  157.    if ans = "2" & depth = 1 then do;
  158.       type = "5"
  159.       return;end
  160.    if ans = "2" & depth >1 then do;
  161.    tr "n1c1Lily Pads Cannot Grow At Depth Selectedq1"
  162.       signal SURFACE;end
  163.    if ans = "3" & depth = 1 then do;
  164.       type = "3" 
  165.       return;end
  166.    if ans = "3" & depth >1 then do;
  167.    tr "n1c1The weeds don't grow that high!         h9q1"
  168.       signal SURFACE;end        
  169. return
  170.  
  171. BOTTOM:
  172. if type = "3" | type = "5" | type = "6" then return
  173. ss "f0n9n6"
  174. tr "Bottom:                             "
  175. tr "           1. Rocky                 "
  176. tr "           2. Sandy                 "
  177. tr "           3. Weeds                 "
  178. tr "           4. Logs                  "
  179. tr "           5. Sunken Vessel                     "
  180. tr "                                                "
  181. ss "Enter a Number Indicating Bottom Feature>   h3"
  182.    getchar
  183.    ans = upper(result)
  184.    if ans <1 | ans >5 then signal BOTTOM
  185.    if ans = "3" then do;
  186.       type = "7";return;end
  187.    if ans = "5" then do;
  188.       type = "8";return;end
  189.    type = ans
  190. return
  191.  
  192. HOT:
  193. ss"f0n9n9n3"
  194. ss "Are There Any Fish in This Area? (Y/N)>   h3"
  195.    getchar
  196.    ans = upper(result)
  197.    if ans = "Y" then do;
  198.      hot = "1";return;end
  199.    if ans = "N" then do;
  200.      hot = "0";return;end
  201. signal HOT
  202. return
  203.  
  204. FISH:
  205. ss "f1"
  206. sf path2||"fish.list"
  207. Do x = 1 to 5
  208.      ss "n1Enter Fish Number "||x||". >   h3"
  209.        receive;ans = upper(result)
  210.        if ans <1 | ans >16 then signal FISH    
  211.        loop = ans
  212.        code.x=ans
  213.        fisha.x = fish.loop
  214.        ss"^2"
  215. end
  216. tr "f1n2Fish Selected for: "||lakename||"n2"
  217.   do x = 1 to 5
  218.    tr "    "||x||"."||" "||fisha.x
  219. end
  220. ss "n1 Okay? [No] >"
  221.     getchar
  222.     ans = upper(result)
  223.     if ans = "Y" then do;
  224.      do x = 1 to 4
  225.     fishlist=fishlist||code.x||"+";end
  226.     fishlist=fishlist||code.5
  227.     return;end
  228.     signal FISH
  229. return
  230.  
  231. DATA:
  232. fish.1="Largemouth Bass";fish.2="Smallmouth Bass";fish.3="Striped Bass"
  233. fish.4="Lake Trout";fish.5="Brown Trout";fish.6="Rainbow Trout"
  234. fish.7="King Salmon";fish.8="Coho Salmon";fish.9="Channel Catfish"
  235. fish.10="Muskellunge";fish.11="Walleye";fish.12="Northern Pike"
  236. fish.13="White Bass";fish.14="Bluegill";fish.15="Crappie";fish.16="Yellow Perch"
  237. map.0="z2 ";map.1="z7 ";map.2="z7 ";map.3="z6 ";map.4="z6 ";map.5="z4 "
  238. map.6="z4 ";map.7="z1 "
  239. launch=0;fishlist=""
  240. blank="000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  241. row.1=blank;row.2=blank;row.18=blank;row.19=blank
  242. return
  243.  
  244. SAVE:
  245. do y=3 to 17
  246.    row.y="000000000000"||row.y||"000000000000"
  247. end
  248. ss "f1n2Enter FILENAME ONLY >"
  249. receive;name=upper(result)
  250. ss "n1Saving..."
  251. call Open(lake,path||name,'W')
  252. call writeln lake , lakename;ss "."
  253.     call writeln lake , fishlist
  254.     call writeln lake , posY
  255.     call writeln lake , posX
  256.   do y = 1 to 19
  257.     call writeln lake , row.y
  258.     end
  259. call close (lake)
  260. call open(map,path1||name,'W')
  261.   do y = 3 to 17
  262.   call writeln map , cmap.y
  263.   ss"."
  264.  end
  265. call close (map)
  266. tr "f1 Data File is in LakeData Dir"
  267. tr " Map File is in LakeMaps Dirn1"
  268. ss "n1Do You Wish To Create Another? [No]>"
  269.    getchar
  270.    ans=result
  271.    if ans = "Y" then signal CREATE
  272. signal quit
  273.  
  274. RESET:
  275. bufferflush
  276. ss "n1Are you Sure? >"
  277.   getchar;ans=upper(result)
  278.   if ans="N" then signal START
  279.   if ans="Y" then do;
  280.      tr "f1Resetting Data Files...n1"
  281.      ss "Tournament Data..."
  282.           code50="No One"
  283.           code51="0"
  284. signal off error
  285.         call open(tourny,path2||"fish.tourny","W")
  286.              do i = 1 to 9
  287.                writeln(tourny,code50)
  288.                writeln(tourny,code51)
  289.              end
  290. signal on error
  291.         call close(tourny)
  292.      ss "Donen1"
  293.      code99="0+0+Freshwater Fishing+Simulator"
  294.      ss "Largest Fish Data..."
  295. signal off error
  296.         call open(big,path2||"fish.biggest","W")
  297.            do i = 1 to 17
  298.            writeln(big,code99)
  299.            end
  300. signal on error
  301.         call close(big)
  302.      ss "Donen1w1"
  303. signal START:  
  304.  
  305. ERROR:
  306. tr "Error in line"SIGL
  307. exit
  308.  
  309. SYNTAX:
  310. tr "Syntax Error in Line"SIGL
  311. exit
  312.  
  313. IOERR:
  314. tr "IO error in Line"SIGL
  315. exit
  316.  
  317. QUIT:
  318. exit
  319.